
<div class="titlebar"><i class="iconfont icon-line-chart_icon"></i>分账数据</div>
<div class="cards">
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$amount_quree/100|money}</div><div class="text">分账队列(￥)</div></div>
    </div>
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$amount_success/100|money}</div><div class="text">分账成功(￥)</div></div>
    </div>
    <div class="card">
        <div class="fn-left"><i class="iconfont icon-renminbi1688"></i></div>
        <div class="fn-right fn-tar"><div class="num">{$amount_fail/100|money}</div><div class="text">分账失败(￥)</div></div>
    </div>
</div>
<div class="titlebar"><i class="iconfont icon-line-chart_icon"></i>分账队列</div>
<div id="actionbar">
    <div class="fn-left button-group">
        <a href="{:url('Mchid/queen',['types' => 0])}" class="button{if $types == 0} button-blue{/if}">分账列表</a>
        <a href="{:url('Mchid/queen',['types' => 1])}" class="button{if $types == 1} button-blue{/if}">结算队列</a>
        <a href="{:url('Mchid/queen',['types' => 2])}" class="button{if $types == 2} button-blue{/if}">结算成功</a>
        <a href="{:url('Mchid/queen',['types' => 3])}" class="button{if $types == 3} button-blue{/if}">结算失败</a>
    </div>
    <div class="fn-right">
        <form id="form" action="{:url('mchid/queen')}" method="get">
            <input type="hidden" id="store_id" name="store_id" value="{$store_id}"/>
            <input id="selectStore" readonly="true" url="s" placeholder="好店名称" class="input w200 selectID" type="text" name="store_name" value="{$store_name}" />
            <input placeholder="请输入订单单号" class="input w250" type="text" name="order" value="{$order}" />
            <input type="submit" value="搜索" class="button button-blue" />
        </form>
    </div>
</div>
<table class="table table-border">
    <thead>
        <tr>
            <th class="w60 fn-tac">状态</th>
            <th class="w200">付款商户</th>
            <th class="w180">收款账户</th>
            <th class="w80 fn-tar">金额</th>
            <th class="w250">分账单号</th>
            <th class="w140">日期</th>
            <th>日志</th>
        </tr>
    </thead>
    <tbody>
        {foreach $lists as $vo}
        <tr>
            <td class="fn-tac">
                {if $vo.is_finish == 1}<span title="重置队列" class="badge bg-red reset fn-cp" url="{:url('mchid/resetQueen',['order' => $vo.out_order_no])}">失败</span>
                {elseif  $vo.is_finish == 2 /}<span class="badge">成功</span>
                {else /}<span class="badge bg-blue">排队</span>{/if}
            </td>
            <td><a href="{:url('store/review',['id' => $vo.store.id])}">{$vo.store.name}</a></td>
            <td>
                {if $vo.types  == 1}
                    【商户号】{if isset($vo.mch.mchid)}
                    <a href="javascript:openwin('{:url('mchid/review',['id' => $vo.mch.id])}')">{$vo.mch.mchid}</a>
                        {else}平台商户号
                    {/if}
                {elseif $vo.types  == 2}
                    <a href="{:url('store/review',['id' => $vo.store.id])}">【好店】{$vo.store.name}</a>
                {else}
                    {if isset($vo.user.nickname)}
                        <a href="javascript:openwin('{:url('user/review',['uid' => $vo.user.id])}')">【个人】{$vo.user.nickname}</href>
                    {/if}
                {/if}
            </td>
            <td class="fn-tar">￥{$vo.amount/100|money}</td>
            <td>
                <svg class="icon" aria-hidden="true"><use xlink:href="#icon-gongzuorizhi"></use></svg> {$vo.out_order_no}<br />
                <svg class="icon" aria-hidden="true"><use xlink:href="#icon-wechat"></use></svg> {$vo.transaction_id}<br />
            </td>
            <td>{if $vo.update_time}{$vo.update_time|date='Y-m-d H:i'}{/if}</td>
            <td>原因：{$vo.msg}<br >
                结果：{if $vo.is_finish}<span class="red">{$vo.sms}</span>{/if}
                {if $vo.is_finish ==2}
                <svg class="icon" aria-hidden="true"><use xlink:href="#icon-wechat"></use></svg> {$vo.order_id}
                {/if}
            </td>
        </tr>
        {/foreach}
    </tbody>
</table>
{$lists|raw}
<script type="text/javascript">
Do('base', 'layer', function () {
    $('.isDel').isDel();
    $('.reset').click(function () {
        var url = $(this).attr("url");
        parent.layer.confirm('确认要发起分账请求',{ icon: 3,title: '友情提示' }, function (index) {
            $.getJSON(url, function (data) {window.location.reload();});
            parent.layer.close(index);
        });
    })
    $(".selectID").win({'url':'{:url("allwin/store/selectStore")}'});
})
function setState(store){
    $("#store_id").val(store.id);
    $("#selectStore").val(store.store_name);
}
</script>